{% extends 'layout.html' %}

{% block home_slogon %}
<ol class="breadcrumb">
  <li><a href="/admin">主页</a></li>
  <li><span>内容首页</span></li>
</ol>
<h3>内容列表</h3>
<table class="table table-hover table-striped">
  <tr>
    <th>ID</th>
    <th>分类名称</th>
    <th>标题</th>
    <th>作者</th>
    <th>添加时间</th>
    <th>阅读量</th>
    <th>操作</th>
  </tr>
  {% for content in contents %}
  <tr>
    <th>{{content._id.toString()}}</th>
    <th>{{content.category.name}}</th>
    <th>{{content.title}}</th>
    <th>{{content.user.username}}</th>
    <th>{{content.addTime.toString()|date('Y-m-d h:i:s', -8*60)}}</th>
    <th>{{content.views}}</th>
    <th>
      <a href="/admin/content/edit?id={{content._id.toString()}}">修改</a>|
      <a href="/admin/content/del?id={{content._id.toString()}}">删除</a>
    </th>
  </tr>
  {% endfor %}
</table>
{% include 'page.html' %}

{% endblock %}
